<?php
error_reporting(0);
$db = db::getInstance();
$name = new DonneesModel();
$get_name = DonneesModel::findByFilter($db, $name);

include("views/lang/lang_fr.php");
session_start();
if ($_GET["l"] == "fr") {
    include("views/lang/lang_fr.php");
    $_SESSION['lang'] = "fr";
} else {
    include("views/lang/lang_en.php");
    $_SESSION['lang'] = "en";
}
?>
<html>
    <head>

        <!-- include style css -->
        <link rel="stylesheet" href="views/css/validationEngine.jquery.css" type="text/css"/>
        <link rel="stylesheet" href="views/css/style_menu.css" type="text/css"/>
        <link rel="stylesheet" href="views/css/mini3537.css" type="text/css"/>
        <link rel="stylesheet" href="views/css/template.css" type="text/css"/>
        <link rel="stylesheet" href="views/css/mini74d5.css" type="text/css"/>
        <link rel="icon" type="image/png" href="views/image/dynamic_form.png" />
        <link rel="stylesheet" href="views/css/template.css" type="text/css"/>
        <link rel="stylesheet" href="views/css/mini74d5.css" type="text/css"/>
        <link rel="stylesheet" href="views/css/coin-slider-styles.css" type="text/css"/>
        <link rel="stylesheet" href="views/css/anim.css" type="text/css"/>       

        <!-- include script js -->
        <script type="text/javascript" src="views/js/jquery-1.6.min.js"></script>
        <script type="text/javascript" src="views/js/ddaccordion.js"></script>
        <script type="text/javascript" src="views/js/menu.js"></script>
        <script type="text/javascript" src="views/js/coin-slider.min.js"></script>
        <script type="text/javascript" src="views/js/coin-slider.js"></script>
        <script type="text/javascript" src="views/js/jquery.easing.1.3.js"></script>

        <script>
            function animation(){
                //logo();
                logo1();
                //                logo2();
                     
            }
            //            function logo(){
            //                $("#logo").animate({left:"+=950px"},5000).animate({left:"-120px"}, 0)
            //                setTimeout("logo()",5000);
            //            }
            function logo1(){
                $("#logo1").animate({left:"+=900px"},9000).animate({left:"-100px"}, 0)
                setTimeout("logo1()",5000);
            }
            //            function logo2(){
            //                $("#logo2").animate({left:"+=900px"},7000).animate({left:"-100px"}, 0)
            //                setTimeout("logo2()",5000);
            //            }
            //               
            $(document).ready(function(){
               
                setInterval('animation();',1000); 
             
                <!--Supprimer un formulaire de la base -->
                $("#supprime").live("click",function(){	
                    var x=$("#selected_form").val();
                    $("#selected_form option:selected").remove();
                    $.post("index/supprimer", {form_supp :x});
                   
                
                });

                <!-- voir le formulaire enregistrer 
                $("#afficher").live("click",function(){
                    $("#router").attr("action","index/apper");

                });

                <!-- editer le formulaire enregistrer 
                $("#editer").live("click",function(){
                    $("#router").attr("action","index/edit");
                });

                <!-- consulter donnees le formulaire enregistrer 
                $("#consulter").live("click",function(){
                    $("#router").attr("action","index/consult");
                });

           
                 
            });

        </script>
    </head>

    <body class="special-page  dark">

        <section id="message">
            <div class="block-border">
                <div class="block-content no-title dark-bg">
                    <p class="mini-infos">
                        <?php echo $titre; ?>
                    </p>

                </div>
            </div>
        </section>
        <div id="wrap">
            <div id="content">
                <div id="logo1"><img src="views/image/logo1.jpg"></div>

            </div>
        </div>
        <div class="container_12">
            <ul id="status-infos">
                <li class="spaced">
                <li>
                    <form name="language" methode="GET" action="index">
                        <button class="grey" id="display_al" name="l" value="fr" onClick="this.form.action='index';this.form.submit()"  onMouseOver="style.cursor='hand'"><img src="views/image/fr.jpg" ></button>
                        <button class="grey" id="display_al" name="l" value="en" onClick="this.form.action='index';this.form.submit()"  onMouseOver="style.cursor='hand'"><img src="views/image/en.jpg"></button>
                    </form>
                </li>
            </ul>
        </div>

        <section id="login-block">
            <div class="block-border">
                <div class="block-content">

                    <div class="block-header"><?php echo $gran_titre ?></div>

                    <form id="router" class="form" action="" method="post">
                        <input id="a" type="hidden" value="send" name="a">
                        <p class="inline-small-label">
                            <label for="login">
                                <strong><?php echo $list ?> </strong>
                            </label>
                            <select name="select_form" id="selected_form" style="border:solid 1px #7f9db9;">

                                <?php
                                foreach ($get_name as $x) {
                                    echo'<option>' . $x->getFormName() . '</option>';
                                }
                                ?>
                            </select>  <button type="submit" id="consulter">Voir les Entr&eacute;es</button>  
                        </p>

                        <p class="inline-small-label">
                        </p>


                        <fieldset class="grey-bg no-margin collapse">
                            <button type="button" class ="red" id="supprime"><?php echo $supp ?></button>
                            <button type="submit" id="editer"><?php echo $Edit ?></button>
                            <button type="submit" id="afficher"><?php echo $aff ?></button>
                        </fieldset>

                        <ul class="favorites no-margin with-tip" title="Context menu available!">
                            <li>
                                <img width="48" height="48" src="views/image/creat.jpg">
                                <a href="index/create">
                                    <?php echo $form ?>
                                    <br>
                                    <small><?php echo $fct ?></small>
                                </a>
                            </li>
                            <li>  
                        </ul>

                    </form>
                </div>
            </div>
        </section>

    </body>

</html>
